package com.cw.controller;


import com.cw.annotation.ResultObjectAnnotation;
import com.cw.common.api.ResultObject;
import com.cw.common.constant.DmlTypeConstant;
import com.cw.entity.ExamineSpecial;
import com.cw.service.IExamineSpecialService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ly
 * @since 2021-09-03
 */
@Api(tags = {"检验特殊处理接口"})
@RestController
@RequestMapping("/examine-special")

public class ExamineSpecialController {

    @Autowired
    private IExamineSpecialService targetService;

    @PostMapping("/save")
    @ApiOperation("新建")
    public ResultObject saveOrUpdate(@RequestBody ExamineSpecial examineSpecial) {
        return ResultObject.successReturn(targetService.insertExamineSpecial(examineSpecial));
    }

    @GetMapping("/getById/{clinicCode}")
    @ApiOperation("查看")
    @ResultObjectAnnotation(DmlTypeConstant.SELECT)
    public Object getById(@PathVariable String clinicCode) {
        return targetService.getExamineSpecialByClinicCode(clinicCode);
    }

}

